package com.sphd.emanu.fragment.mine;

import android.content.Context;

import com.google.gson.JsonObject;
import com.sphd.emanu.mvp.BasePresenterImpl;

import okhttp3.MultipartBody;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
import retrofit2.http.Part;

/**
 * MVPPlugin
 * 邮箱 784787081@qq.com
 */

public class MinePresenter extends BasePresenterImpl<MineContract.View> implements MineContract.Presenter {

    @Override
    public void updateUserImage(Integer id,MultipartBody.Part imgs) {
        emanuService.updateUserImage(id, imgs).enqueue(new Callback<JsonObject>() {
            @Override
            public void onResponse(Call<JsonObject> call, Response<JsonObject> response) {
                    mView.setRes(res(response));
            }

            @Override
            public void onFailure(Call<JsonObject> call, Throwable t) {
                Error(t);
            }
        });
    }
}
